/* 组件样式 - Modern Tailwind Style */

/* 侧边栏底部 */
.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--gray-100);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
}

/* 常用词模块样式 - Refined Design */
.common-words-container {
    max-width: 1000px;
}

.word-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    padding: 8px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.category-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    position: relative;
    white-space: nowrap;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-500);
    border-radius: 12px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: -1;
}

.category-btn.active {
    color: white;
    font-weight: 600;
}

.category-btn.active::before {
    opacity: 1;
    transform: scale(1);
}

.category-btn:hover:not(.active) {
    background: var(--primary-50);
    color: var(--primary-700);
    transform: translateY(-1px);
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.word-tag {
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--gray-100);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.word-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.word-tag:hover::before {
    left: 100%;
}

.word-tag:hover {
    border-color: var(--primary-500);
    color: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.word-tag.selected {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-color: var(--primary-600);
    color: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* 对话生成样式 - Premium Card Design */
.conversation-container {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-100);
    position: relative;
}

.conversation-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
}

.conversation-header {
    padding: 24px 32px;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
    border-bottom: 1px solid var(--gray-100);
}

.conversation-input {
    padding: 32px;
}

.input-area {
    background: var(--gray-50);
    border: 2px solid var(--gray-100);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    position: relative;
}

.input-area:focus-within {
    background: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.input-area textarea {
    width: 100%;
    border: none;
    background: none;
    resize: vertical;
    min-height: 120px;
    font-size: 16px;
    color: var(--gray-900);
    font-weight: 400;
    line-height: 1.6;
}

.input-area textarea:focus {
    outline: none;
}

.input-area textarea::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.conversation-output {
    padding: 32px;
    border-top: 1px solid var(--gray-100);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
}

.output-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 2px solid var(--gray-100);
    position: relative;
    box-shadow: var(--shadow-md);
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-800);
}

.output-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-brand);
    border-radius: 18px;
    z-index: -1;
    opacity: 0.1;
}

.output-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

.btn-copy {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn-copy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-copy:hover::before {
    left: 100%;
}

.btn-copy:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 设置页面样式 - Clean Design */
.settings-container {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-100);
    position: relative;
}

.settings-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-brand);
    border-radius: 24px 24px 0 0;
}

.settings-section {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--gray-100);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-50);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 15px;
}

.toggle-switch {
    position: relative;
    width: 56px;
    height: 28px;
    background: var(--gray-200);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--gray-100);
}

.toggle-switch.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after {
    transform: translateX(28px);
}

/* 模板卡片样式 */
.templates-grid {
    display: grid;
    gap: 20px;
}

.template-card {
    background: white;
    border: 2px solid var(--gray-100);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-card:hover {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.template-card:hover::before {
    opacity: 0.03;
}

.template-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.template-content {
    color: var(--gray-600);
    line-height: 1.6;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.template-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.btn-use {
    background: var(--primary-500);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-use:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-radius: 50%;
    border-top-color: var(--primary-500);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 消息提示 */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: #6ee7b7;
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: #f87171;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .content-header {
        padding: 24px 32px;
    }
    
    .content-body {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 16px;
        gap: 8px;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 12px 20px;
        margin: 0;
        min-width: max-content;
    }
    
    .words-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .auth-card {
        padding: 32px 24px;
    }
    
    .content-header {
        padding: 20px 24px;
    }
    
    .content-body {
        padding: 24px;
    }
    
    .conversation-input {
        padding: 24px;
    }
    
    .settings-container {
        padding: 24px;
    }
}